<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>后台管理中心</title>
        {$system_css}
        {$system_js}
        <script type="text/javascript">
            $(function(){
                //颜色插件
                $("#bn").bigColorpicker("color");
                
                
                $("#myform").validate({
                    rules: {
                        name: "required",
                        en_name:"required",
                        {if $data.icon == ''}
                        icon:"required",
                        {/if}
                        star_num:{
                            number:true,
                            max:10
                        },
                        experience:'required'
                    },
                    messages: {
                        name: "用户组的名称不能为空",
                        en_name:"英文名称不能为空",
                        icon:"ICON不能为空",
                        star_num:{
                            number:"星数必须为数字",
                            max:'必须为0-10的数字'
                        },
                        experience:"经验数不能为空"
                    }
                });
            })
        </script>
    </head>
    <body>
        {include file="message.html"}
        <div class="pad-10">
            <div class="common-form">
                <form name="myform" action="#" method="post" id="myform" enctype="MULTIPART/FORM-DATA" >
                    <fieldset>
                        <legend>基本信息</legend>
                        <table width="100%" class="table_form">
                            <tr>
                                <td width="80"  class="red">用户组名</td> 
                                <td><input type="text" name="name"  class="input-text" id="name" size="50" value="{$data.name}"></input></td>
                            </tr>
                            
                              <tr>
                                <td width="80"  class="red">英文名</td> 
                                <input type="hidden" value="{$data.en_name}" name="en_name"/>
                                <td><input type="text" name="en_name2"  class="input-text" id="en_name" size="50" value="{$data.en_name}" {if $data.en_name == 'youke_user'}disabled{/if}></input>{if $data.en_name == 'youke_user'}游客的此字段不能修改{/if}</td>
                            </tr>

                            <tr>
                                <td width="80"  class="red">经验数</td> 
                                <td><input type="text" name="experience"  class="input-text" id="experience" size="20" value="{$data.experience}"></input></td>
                            </tr>

                            <tr>
                                <td width="80">星级数量</td> 
                                <td><input type="text" name="star_num"  class="input-text" id="star_num" size="20" value="{$data.star_num}"></input></td>
                            </tr>
                            
                            
                            
                            <tr>
                                <td>
                                    是否禁用
                                </td>
                                <td>
                                    <label style="width:88px"><input type="radio" value="1"  name="active" {if $data.active==1}checked="checked"{/if}> 是 </label>
                                    <label style="width:88px"><input type="radio" value="0"   name="active" {if $data.active==0}checked="checked"{/if}> 否 </label>
                                </td> 
                            </tr>

                            <tr>
                                <td width="80">用户名颜色</td> 
                                <td>	
                                    <input type="text" name="color" value="{$data.color}"  class="input-text color" id="color" size="10"></input>
                                    <input id="bn" type="button" value="选色" />
                                </td>
                            </tr>

                            <tr>
                                <td  class="red">图标</td> 
                                <td><input type="file" name="icon" id="icon" />&nbsp;&nbsp;<img src="{$data.icon}" width="50" height="50" style="border:1px solid #ccc;"></td>
                            </tr>
                            <tr>
                                <td>描述</td> 
                                <td> <textarea  style="width:50%;height:46px;"  name="description">{$data.description}</textarea></td>
                            </tr>

                            <tr>
                                <td>权限设置</td>
                                <td>
                                    {if count($privilege_list)>0}
                                    {foreach from=$privilege_list item=list}
                                    <div style="border-bottom: 1px solid #ccc"> 
                                        <p style="margin: 5px 0 5px 0;"> <input type="checkbox" name="privilege_id[]" value="{$list.id}" id="privilege_{$list.id}" {if in_array($list.id,$data.privilege_list)}checked='true'{/if}/><label for="privilege_{$list.id}">{$list.name|translate}</label></p>
                                        <div id="privilege_sub_{$list.id}">
                                        {if  count($list.children)>0}
                                        {foreach from=$list.children item=children}
                                        <input type="checkbox" name="privilege_id[]" value="{$children.id}" id="privilege_{$children.id}" {if in_array($children.id,$data.privilege_list)}checked='true'{/if} /><label for="privilege_{$children.id}">{$children.name|translate}</label>
                                        {/foreach}
                                        {/if}
                                        </div>
                                    </div>
                                    {/foreach}
                                    {/if}
                                </td>
                            </tr>
                            <tr>
                                <td>排序</td>
                                <td>
                                    <input type="text" name="position" class="input-text" size="10" value="{$data.position}"></input>
                                </td>
                            </tr>
                            <tr align="center">
                                <td colspan="2">
                                    <input type="submit" value="提交" name="dosubmit" class="button">
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>
        </div>


    </body>
</html>